<!DOCTYPE html>
<html style=" height:100%">

	<head>
		<meta charset="utf-8">
		<title>系统登录</title> 
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="css/app.css" />
		<link rel="stylesheet" href="css/Site.css">
		<script src="js/mui.js"></script>
		<script src="js/common.js"></script>
		<style>
			.mui-row.mui-fullscreen>[class*="mui-col-"] {
				height: 100%;
			}
			
			.mui-col-xs-3,
			.mui-control-content {
				overflow-y: auto;
				height: 100%;
			}
			
			.mui-segmented-control .mui-control-item {
				line-height: 50px;
				width: 100%;
			}
			
			.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active {
				background-color: #fff;
			}
			
			.xyhzc {
				color: #278c54;
				font-family: "微软雅黑";
				font-weight: bold;
				font-size: 12px;
				margin-right: 20px;
			}
			.mui-btn-block{ padding:8px; background-color:#fa1948 ;}
			.mui-btn-primary{border: 1px solid #fa1948;}
			input[type=password],input[type=text]{height:43px}
		</style>
	</head>

	<body class="login_bg">
		<header class="mui-bar mui-bar-nav" style="background-color:#fa1948;">
		
			<h1 class="mui-title" style="color:#fff;font-size:22px; font-weight:bold;">协同智能办公系统</h1>
		</header>
		<div style="background-image:url(img/login-bg1.jpg); background-repeat:no-repeat;background-size:100% 100%;  padding-top:80px ; text-align: center;">
			
			<img src="img/LOGO.png" style=" margin-bottom:30px ;height:50px"/>
			
			<div style=" padding:10%; padding-top:0px;">

				<div class="mui-input-row mui-password">
					<input id="username" type="text" class="mui-input-clear new-input1" value="" placeholder="请输入账号">
				</div>

				<div class="mui-input-row mui-password">
					<input id="password" type="password" class="mui-input-password new-input2" value="" placeholder="请输入密码">
				</div>
			</div>
		</div>
		<div style=" padding:10% ; padding-top:10px;">
			<div id="fftemp">
				<button id='login' class="mui-btn mui-btn-block mui-btn-primary" >登录</button>
			
			</div>

		</div>
		<div class="mui-bottom" style=" font-weight: normal; color:#999">Copyright ©2016 江苏明鹿物联技术股份有限公司</div>
	</body>
	<script type="text/javascript">
		mui.init({
			preloadPages:[
		    {
		      url:'index.html',
		      id:'index.html'
		    }
		  ]
		});
		var first = null;
		mui.back = function() {
			//首次按键，提示‘再按一次退出应用’
			if(!first) {
				first = new Date().getTime();
				mui.toast('再按一次退出应用');
				setTimeout(function() {
					first = null;
				}, 3000);
			} else {
				if(new Date().getTime() - first < 3000) {
					plus.runtime.quit();
				}
			}
		};
		mui.plusReady(function(){
			var closeSplashscreen = plus.webview.currentWebview().closeSplashscreen;
			if(closeSplashscreen){
				plus.navigator.closeSplashscreen();
			}
		});
		var login = document.getElementById("login");
		login.addEventListener("tap", function() {
			var username = document.getElementById("username").value;
			var password = document.getElementById("password").value;
			if(username.trim() == "") {
				mui.toast('请输入用户名');
				return false;
			}
			if(password.trim() == "") {
				mui.toast('请输入密码');
				return false;
			}
			mui.post(serviceUrl + "phone/moblogin.html", {
				name: username,
				password: password
			}, function(msg) {	
				var data = eval('(' + msg + ')'); //				
				if(data.status == "1") {					
					plus.storage.setItem("userid",escape(data.userId));
					plus.storage.setItem("username",escape(username));
					plus.storage.setItem("userpwd",escape(password));
					plus.storage.setItem("remember",escape("true"));					
//					plus.storage.setItem("userroleid",escape("admin"+(data.roleId).toString()));
					mui.openWindow({
						id: 'index.html'
					});
				} else {
					mui.toast(data.message);					
				}
			});
		});
	</script>

</html>